#!/bin/bash
counter=$(ps -C nginx --no-heading|wc -l)
if [ "${counter}" = "0"  ]; then
     systemctl start nginx.service
     sleep 2
     counter=$(ps -C nginx  --no-heading|wc -l)
     if [ "${counter}" =  "0" ]; then
          systemctl stop keepalived.service
     fi
fi